<template>
    <div class="box">
        <el-header style="text-align: right; font-size: 25px">
            <div>后台管理系统</div>
            <button @click="logout" class="btn">注销</button>
        </el-header>
    </div>
</template>

<script>
//注销功能
export default {
    methods: {
        logout() {
            if (!confirm('确定要注销吗？')) return;
            this.$http.get('/users/backend/logout').then(({data: {code}}) => {
                    if (code != 1) return alert('注销失败！');
                    this.$store.commit('logout');
                    this.$router.push('/login');
                })
        }
    }
}
</script>
<style scoped>

.el-header {
    background-color: #03142e;
    color: #ffffff;
    line-height: 55px;
    display: flex;
    justify-content: space-between;
}

.btn {
    font-size: 20px;
    font-weight: 400;
    border: none;
    outline: none;
    color: #ffffff;
    background-color: #03142e;
}
</style>